@mixin C() {
    /* -------------------------------------
   colors */
}

$content-fg : #333;
$content-light: #999;
$orange-bg : #ef6639;
$white : #fff;
$panel-text : #000;
$panel-top : #eee;
$panel-bottom : #ddd;
$code-link : #6f41a7;
$content-link : #ee543d;
@mixin C() {
    /* -------------------------------------
   mixins */
}

@mixin Delistify() {
    list-style: none;
    margin: 0;
    padding: 0;
    display: inline;
}

@mixin MainBG() {
    color: $white;
    -webkit-background-size: cover;
    background-color: $orange-bg;
    background-image: url(/assets/images/swift-bg.jpg);
    background-position: 50% 50%;
    background-repeat: no-repeat;
    background-size: cover;
}

html,
body {
    height: 100%;
}

body {
    font: 17px/21px -apple-system, 'Helvetica Neue', Helvetica, sans-serif;
    color: $content-fg;
}

#navbar {
    display: block;
}

#sidebar,
#header {
    display: none;
}

#wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -60px;
}

#header {
    @include MainBG;
    height: 80px;
    text-align: center;
    font-family: 'Avenir Next', Avenir, sans-serif;
    h1 {
        font-size: 40px;
        font-weight: normal;
        margin: 20px 15px 7px;
        a:hover {
            text-decoration: none;
        }
    }
    a {
        color: $white;
    }
    p {
        display: none;
    }
    .form-group {
        margin: 27px 20% 0;
        text-align: left;
        color: #777;
    }
}

body.home {
    #header {
        height: 275px;
        h1 {
            font-size: 60px;
            font-weight: normal;
            margin-top: 40px;
        }
        p {
            color: rgba(255, 255, 255, 0.7);
            font-size: 20px;
            display: block;
        }
        .dropdown {
            margin-top: 12px;
            button {
                font-size: 17px;
            }
            .dropdown-menu {
                left: 41%;
            }
            a {
                color: #333;
            }
        }
    }
}

.home-block {
    border-top: 1px solid $panel-top;
    padding-bottom: 40px;
    h2 {
        margin-top: 40px;
    }
}

.navbar-default {
    margin-bottom: 0;
    border: none;
    .navbar-right>li>a {
        padding: 7px 15px 7px 20px;
    }
    .navbar-header {
        @include MainBG;
    }
    .navbar-form {
        border: none;
        padding-top: 0;
        padding-bottom: 0;
    }
    .dropdown-toggle,
    .dropdown-menu {
        width: 100%;
    }
    .navbar-toggle {
        border-color: $white;
        &:hover {
            background-color: rgba(255, 255, 255, 0.4);
        }
        .icon-bar {
            background: $white;
        }
    }
    .divider {
        height: 1px;
        margin: 9px 0;
        overflow: hidden;
        background-color: #e5e5e5;
    }
    h1 {
        font-size: 32px;
        margin: 9px 7px 0 15px;
        display: inline-block;
        a {
            color: $white;
            &:hover {
                text-decoration: none;
            }
        }
    }
}

.select2-results {
    li {
        font-size: 0.9em;
        .kind {
            color: #666;
            font-weight: 300;
        }
    }
    .select2-highlighted {
        background-color: $orange-bg;
        color: $white;
        font-weight: 600;
        .kind {
            color: $white;
            font-weight: 300;
        }
    }
}

.select2-container .select2-choice {
    font-family: 'Avenir Next', 'Avenir', sans-serif;
}

.select2-chosen,
.select2-choice>span:first-child {
    padding-top: 7px;
}

.input .form-control-feedback,
.input-group .form-control-feedback {
    top: 0;
}

.input-lg .form-control-feedback,
.input-group-lg .form-control-feedback {
    top: 7px;
    right: 7px;
}

#home-select.col-xs-3 {
    padding-right: 5px;
}

#home-search.col-xs-9 {
    padding-left: 3px;
}

#wrapper .select2-arrow {
    display: none;
}

.navbar-left .form-group {
    width: 100%;
}

#sidebar {
    .form-group {
        margin: 35px 0 0;
        width: 100%;
    }
    .dropdown {
        margin-top: 8px;
        font-weight: normal;
        font-size: 14px;
        .btn-default {
            background: transparent;
        }
    }
    #select-container {
        width: 100%;
    }
    #accordion {
        display: none;
        margin: 30px 0;
        .panel {
            color: $panel-text;
            background: $panel-bottom;
            background-image: -webkit-linear-gradient(top, $panel-top, $panel-bottom);
            background-image: linear-gradient(to bottom, $panel-top, $panel-bottom);
        }
        .panel-body {
            padding: 0;
        }
        .panel {
            border: none;
        }
        .panel-group .panel-heading+.panel-collapse>.panel-body {
            border: none;
        }
        .list-group {
            border-radius: 0;
        }
        .list-group-item {
            font-size: 0.8em;
            border-top: 0;
            border-bottom: 0;
            padding: 5px 15px;
            overflow-x: hidden;
        }
        .list-group-item.current {
            font-weight: bold;
        }
        .list-group-item:first-child {
            border-radius: 0;
        }
        .subnav-header {
            font-weight: bold;
            padding-top: 15px;
            color: $content-fg;
        }
    }
    #intranav {
        font-size: 0.8em;
        h4 {
            margin: 2em 0 0.2em;
            text-transform: uppercase;
            font-size: 0.9em;
            color: #999;
        }
        ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
    }
    #display {
        li {
            color: #999;
        }
    }
    #fixed-sidebar.affix {
        top: 0;
    }
}

h2 {
    font-size: 40px;
    font-weight: normal;
    margin: 35px 0 25px;
}

.p-news h2 {
    font-weight: 600;
}

a {
    color: $content-link;
}

#version {
    background: #eee;
    .container {
        text-align: center;
        padding: 5px 0;
    }
}

.content {
    margin: 0 0 50px;
    h3 {
        font-size: 22px;
        font-weight: 500;
        margin: 30px 0 5px;
    }
    h4 {
        margin-top: 30px;
        font-size: 15px;
        &:first-child {
            margin-top: 0;
        }
    }
    .main-list {
        list-style: none;
        margin: 0;
        padding: 0;
        li {
            list-style: none;
            margin: 0 0 3px;
            padding: 0;
            white-space: nowrap;
            overflow: hidden;
        }
    }
    .viz {
        display: block;
        a {
            display: inline-block;
            margin: 0 0 6px -8px;
            padding: 3px 8px;
            background: white;
            color: $content-link;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            &:hover {
                color: white;
                background: $content-link;
                text-decoration: none;
            }
        }
        &:first-child {
            a {
                margin-top: 6px;
            }
        }
    }
    .syntaxhighlighter {
        border-radius: 4px;
        .caption {
            display: none;
        }
        .container {
            width: auto;
            li {
                border-left: none;
                margin-left: 4em;
                text-indent: -4em !important;
                white-space: normal !important;
            }
        }
        .container::before,
        .container::after {
            content: none;
        }
        a {
            color: $code-link !important;
            text-decoration: underline;
            :hover {
                color: $code-link !important;
            }
        }
    }
    pre {
        border: none;
        border-radius: 5px;
        padding: 10px 0 10px 15px;
        background: #f6f6f6;
    }
    .comment {
        margin: 0 0 20px;
        font-size: 15px;
        line-height: 1.4em;
        h1 {
            margin: 25px 0 5px;
            font-size: 22px;
            font-weight: 600;
        }
        h2 {
            margin: 1.8em 0 0.2em;
            font-size: 15px;
            text-transform: uppercase;
            font-weight: 600;
        }
        h4 {
            font-size: 14px;
            margin: 12px 0 4px;
        }
        p {
            margin: 10px 0;
        }
        strong {
            font-weight: 600;
        }
        .syntaxhighlighter {
            font-size: 15px;
            margin: 0 !important;
            ul.container {
                li:last-child {
                    padding-bottom: 0 !important;
                }
            }
            code {
                line-height: 1.7em;
            }
        }
        code {
            font-size: 0.85em;
        }
    }
    .intro-declaration {
        font-size: 1.1em;
    }
    .discussion {
        font-size: 16px;
    }
    .declaration {
        margin: 10px 0;
        line-height: 17px;
        .comment {
            margin: 0;
            line-height: 1.4em;
            .p {
                padding: 0 0 15px 25px;
            }
        }
        .required {
            display: inline-block;
            font-size: 10px;
            line-height: 15px;
            padding: 1px 6px;
            top: -2px;
            position: relative;
            border-radius: 4px;
            color: #fff;
            background: #aaa;
            text-transform: uppercase;
        }
    }
    .noninherited {
        font-size: 0.8em;
        font-style: italic;
        color: #999;
        display: none;
    }
    a.toggle-link {
        font-size: 14px;
        line-height: 18px;
        font-family: Menlo, Consolas, monospace;
        color: #999;
        text-decoration: none;
        display: inline-block;
        margin-left: 25px;
        text-indent: -25px;
        .identifier {
            color: $code-link;
        }
    }
    code {
        background: transparent;
        color: inherit;
        font-size: 0.75em;
        padding: 0;
        a {
            color: $code-link;
            text-decoration: underline;
            border: none;
            :hover {
                color: $code-link;
            }
        }
    }
    table.standard {
        border: none;
        border-top: 1px solid #ccc;
        margin: 2em 0;
        display: block;
        tr {
            border-bottom: 1px solid #ccc;
            display: block;
        }
        th,
        td {
            vertical-align: top;
            display: block;
        }
        th {
            font-weight: 500;
            padding: 10px 0 0 0;
            font-size: 15px;
            margin: 10px 0 0;
        }
        td {
            margin-bottom: 10px;
            .syntaxhighlighter {
                margin: 10px 0 4px !important;
            }
            .declaration {
                margin: 10px 0 15px;
                .comment {
                    margin: 0;
                    padding: 0;
                    background: none;
                }
            }
            h5 {
                margin: 13px 0 -7px;
            }
            .inherits,
            .nested {
                margin: 10px 0;
                display: inline-block;
            }
            .noninherited {
                margin: 10px 0;
            }
        }
    }
}

.posts {
    line-height: 23px;
    .post {
        margin: 35px 0 70px;
    }
    h1 {
        font-size: 36px;
        font-weight: 500;
        margin: 0;
        a {
            color: #000;
        }
    }
    h2 {
        font-size: 22px;
        font-weight: 600;
        margin: 20px 0 7px;
    }
    h3 {
        font-size: 17px;
        font-weight: 600;
        margin: 18px 0 7px;
    }
    header {
        margin: 0 0 15px;
    }
    .date {
        color: $content-light;
        margin: 0 0 5px;
    }
    p {
        margin: 0 0 15px;
    }
    .release {
        h1 {
            display: inline-block;
            font-size: 17px;
            margin-left: 5px;
        }
        .date {
            display: inline;
        }
    }
    .tags {
        font-size: 0.85em;
        a {
            display: inline-block;
            margin-left: 3px;
        }
        .glyphicon {
            color: #bbb;
            font-size: 13px;
            position: relative;
            top: 3px;
        }
    }
    code {
        font-size: 14px;
    }
    .syntaxhighlighter {
        font-size: 1em !important;
        margin: 0 !important;
    }
}

.postlist {
    @include Delistify;
    li {
        @include Delistify;
        margin-bottom: 10px;
        display: block;
    }
    .date {
        color: $content-light;
        white-space: nowrap;
    }
}

/* hierarchy SVG embed pages */

.p-hierarchy {
    .container {
        width: auto;
        padding-top: 10px;
    }
    #footer {
        background: none;
        text-align: left;
        padding-left: 15px;
        color: $content-light;
        a {
            color: $content-light;
        }
    }
}

.push {
    height: 60px;
}

#footer {
    width: 100%;
    padding: 2em 0;
    margin-top: 2em;
    border-top: 1px solid #ddd;
    font-size: 0.75em;
    line-height: 1.3em;
    p {
        margin: 0 0 1em;
    }
}

@media (min-width: 768px) {
    #navbar,
    .jumbotron p {
        display: none;
    }
    #sidebar,
    #header {
        display: block;
    }
    #wrapper {
        margin-bottom: -40px;
    }
    .push {
        height: 40px;
    }
    .content {
        table.standard {
            display: table;
            tr {
                display: table-row;
            }
            th {
                margin: 0;
                display: table-cell;
                white-space: nowrap;
                padding: 10px 20px 10px 0;
            }
            td {
                display: table-cell;
                margin-bottom: 5px;
            }
        }
    }
}
